using UnityEngine;

public class EnemyBullet : MonoBehaviour
{
    public Vector3 direcition;
    public float Speed = 6;

    void Start()
    {
        direcition.Normalize();
        enabled = true;
    }

    void Update()
    {
        transform.position += direcition * Speed * Time.deltaTime;
    }

    void OnCollisionEnter2D(Collision2D collisionInfo)
    {
        if (collisionInfo.gameObject.GetComponent<Player>())
        {
            // collisionInfo.gameObject.SetActive(false);
            Destroy(gameObject);
            Global.player.Hurt(1);
        }
    }
}
